package com.quarters.bean;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Arrays;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



/**
 * <p>
 * 
 * </p>
 *
 * @author 冯政尚
 * @since 2019-09-02
 */
@ApiModel(value="UserInfo对象", description="")
public class UserInfo extends Model<UserInfo> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId("id")
    private Long id;

    @ApiModelProperty(value = "用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Long createTime;

    @ApiModelProperty(value = "上级id")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty(value = "微信用户的openId")
    @TableField("open_id")
    private String openId;

    @TableField(exist = false)
    private Role roles;
    @TableField(exist = false)
    private  String  roleName;

    @TableField(exist = false)
    private  String  quartersNameList;

    @ApiModelProperty(value = "昵称")
    @TableField(exist = false)
    private byte[] nickName;

    public String getNickName() {
        if(nickName==null){
            return null;
        }
        return new String(nickName);
    }

    public void setNickName(byte[] nickName) {
        this.nickName = nickName;
    }

    public String getQuartersNameList() {
        return quartersNameList;
    }

    public void setQuartersNameList(String quartersNameList) {
        this.quartersNameList = quartersNameList;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Role getRoles() {
        return roles;
    }

    public void setRoles(Role roles) {
        this.roles = roles;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", createTime=" + createTime +
                ", parentId=" + parentId +
                ", openId='" + openId + '\'' +
                ", roles=" + roles +
                ", roleName='" + roleName + '\'' +
                ", quartersNameList='" + quartersNameList + '\'' +
                ", nickName=" + Arrays.toString(nickName) +
                '}';
    }
}
